package com.hundsun.documentripper.domain.dto;

import com.hundsun.documentripper.domain.pojo.DocumentTemplate;
import com.hundsun.documentripper.domain.pojo.DocumentTemplateRelation;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
public class DocumentTemplateSource extends DocumentTemplate implements Serializable {

    private static final long serialVersionUID = -1018710078298513436L;

    private List<DocumentTemplateRelation> relationList;

    /**
     * 文档模板关联的节点模板展示
     */
    private List<DocumentTemplateRelationView> relationViewList;

    public static DocumentTemplateSource formDocumentTemplate(DocumentTemplate documentTemplate) {
        DocumentTemplateSource documentTemplateSource=new DocumentTemplateSource();
        documentTemplateSource.setUuid(documentTemplate.getUuid());
        documentTemplateSource.setDocTemplateCode(documentTemplate.getDocTemplateCode());
        documentTemplateSource.setDocTemplateName(documentTemplate.getDocTemplateName());
        documentTemplateSource.setDocTemplateDesc(documentTemplate.getDocTemplateDesc());
        documentTemplateSource.setCreateUser(documentTemplate.getCreateUser());
        documentTemplateSource.setCreateTime(documentTemplate.getCreateTime());
        documentTemplateSource.setModifyUser(documentTemplate.getModifyUser());
        documentTemplateSource.setModifyTime(documentTemplate.getModifyTime());
        return documentTemplateSource;
    }

}
